/*
 * sample-common.h
 *
 * Copyright (C) 2014 Ingenic Semiconductor Co.,Ltd
 */

#ifndef __SAMPLE_COMMON_H__
#define __SAMPLE_COMMON_H__

#include <imp/imp_common.h>
#include <imp/imp_osd.h>
#include <imp/imp_framesource.h>
#include <imp/imp_isp.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/prctl.h>

#ifdef __cplusplus
#if __cplusplus
extern "C"
{
#endif
#endif /* __cplusplus */

#define SENSOR_FRAME_RATE_NUM		25
#define SENSOR_FRAME_RATE_DEN		1

#define SENSOR_SC301IoT

#ifdef SENSOR_SC301IoT
#define SENSOR_NAME				"sc301IoT"
#define SENSOR_CUBS_TYPE		TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR			0x30
#define SENSOR_I2C_ADAPTER_ID	0
#define SENSOR_WIDTH			2048
#define SENSOR_HEIGHT			1536
#define CHN0_EN					1
#define CHN1_EN					0
#define CHN2_EN					0
#define CROP_EN					0
#else
#define SENSOR_NAME				"gc2053"
#define SENSOR_CUBS_TYPE		TX_SENSOR_CONTROL_INTERFACE_I2C
#define SENSOR_I2C_ADDR			0x37
#define SENSOR_I2C_ADAPTER_ID	0
#define SENSOR_WIDTH			1920
#define SENSOR_HEIGHT			1080
#define CHN0_EN					1
#define CHN1_EN					0
#define CHN2_EN					0
#define CROP_EN					0
#endif


#define SENSOR_WIDTH_SECOND		704
#define SENSOR_HEIGHT_SECOND	576

#define SENSOR_WIDTH_THIRD		1280
#define SENSOR_HEIGHT_THIRD		720

#define BITRATE_720P_Kbs		1000
#define NR_FRAMES_TO_SAVE		200

#define STREAM_FILE_PATH_PREFIX		"/tmp"
#define SNAP_FILE_PATH_PREFIX		"/tmp"

#define OSD_REGION_WIDTH		16
#define OSD_REGION_HEIGHT		34
#define OSD_REGION_WIDTH_SEC		8
#define OSD_REGION_HEIGHT_SEC		18

#define FS_CHN_NUM			3  //MIN 1,MAX 3
#define IVS_CHN_ID			2

#define CH0_INDEX			0
#define CH1_INDEX			1
#define CH2_INDEX			2

#define CHN_ENABLE			1
#define CHN_DISABLE			0


struct chn_conf{
	unsigned int index;//0 for main channel ,1 for second channel
	unsigned int enable;
	IMPPayloadType  payloadType;
	IMPFSChnAttr fs_chn_attr;
	IMPCell framesource_chn;
	IMPCell imp_encoder;
};

#define  CHN_NUM  ARRAY_SIZE(chn)

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

#endif /* __SAMPLE_COMMON_H__ */
